
SOURCES = Split('''
    pointer.cpp
    arg.cpp
    Exception.cpp
    pyxx_helper.cpp
''')

Import('env')

env.Prepend(
    CPPPATH = ['../include'],
    CPPDEFINES = ['BOOST_ALL_NO_LIB','RXX_ALLOCATOR_INIT_0']
)

if env['VARIANT'] == 'debug':
    env.Append( CPPDEFINES = ['BOOST_DEBUG_PYTHON'] )
    env['PDB'] = 'pyxx_helper.pdb'

def build_version_header( target, source, env):
    context = {}
    exec open( str(source[0]) ) in context
    open( str(target[0]), 'w').write(
"""
const char * version_text = "%(__version__)s";
""" % context)
        

env.Command( 'version.h', '../pyxx/version.py', build_version_header)

pyd = env.PyExtModule( 'pyxx_helper', SOURCES )
Return('pyd')
